public class Test10 {
    public static void main(String[] args) {
        System.out.println("666");
        //通过new关键字实例化了一个Dog对象
        //d1是一个引用，它指向了dog对象
        Dog d1 = new Dog();
        d1.age = 10;
        d1.name = "旺财";
        d1.color = "黄色";
        System.out.println(d1.name);
        System.out.println(d1.age);
        System.out.println(d1.color);
        d1.eat();
        d1.bark();
        System.out.println("************************");
        Dog d2 = new Dog();
        d2.age = 9;
        d2.name = "旺汪";
        d2.color = "红色";
        System.out.println(d2.name);
        System.out.println(d2.age);
        System.out.println(d2.color);
        d2.eat();
        d2.bark();
        d2.sleep();
    }
}
//类名一定要用大驼峰
class WashMachine{
    //属性（成员属性）：定义在类里边方法的外边，而局部变量定义在方法内部
    public String brand;    //品牌
    public String type;     //型号
    public String color;    //颜色
    //别带static
    //行为（成员方法）
    public void washCloths(){//洗衣服
        System.out.println("洗衣服");
    }
    public void dryCloth(){//甩干
        System.out.println("甩干");
    }
}
class Dog{
    public String name;
    public String color;
    public int age;
    public void eat(){
        System.out.println(name + "吃饭");
    }
    public void sleep(){
        System.out.println(name + "睡觉");
    }
    public void bark(){
        System.out.println(name + "狗叫");
    }

    public static void main(String[] args) {
        System.out.println("汪汪汪");
    }
}
